<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@page import="java.util.*"%>
<%@page import="cn.gpnu.QQMusic.database.domain.Favorite"%>
<%@page import="cn.gpnu.QQMusic.database.domain.Music"%>
<%@page import="cn.gpnu.QQMusic.database.domain.User"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>搜索</title>
<link rel="stylesheet" href="css/search.css" type="text/css"/>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/search.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.3.1.js" ></script>
<style type="text/css">

	</style>

</head>
<body>
	<jsp:include page="head.jsp" ></jsp:include>
	<div class="mod_search" style="background-image:url(images/111.png);" role="search">
		<div class="mod_search_input">
		<form  action="SearchSerlet"method="post" >
			<input class="search_input__input" name="search" aria-label="请输入搜索内容" placeholder="搜索音乐、MV、歌单、用户">
			<input class="search_input_submit" type="submit" value="查找歌曲">
		</form>	
		</div>
	</div>
	<div id="myCol">
			<a class="a142" id="allpaly" onclick="playAll()" href="javascript:void(0)" >批量播放</a>
			<a class="a142" href="javascript:void(0)" >添加到</a>
			<a class="a142" href="javascript:void(0)" onclick="downloadAll();" >批量下载</a>
			<a class="a142" href="javascript:void(0)" onclick="delAll();">批量删除</a><br /><br /><br /><br />
			<div id="music_list">
				<table id="ta1">
					<tr>
						<th class="th1"></th>
						<th class="th2">歌曲</th>
						<th class="td_img"></th>
						<th class="th3">歌手</th>
						<th class="th3">专辑</th>
						<th class="th4">时长</th>
					</tr>
				</table>
				<table id="ta2">	
				<%
					int j=0;
				%>	
				<c:forEach var="music"  items="${findmusic}">
				<tr class="tr${sessionScope.count}"  onmousemove="change_5('t${music.mid}');"onmouseout="change_6('t${music.mid}')">
					<td class="td1" id="w${music.mid}"><input type="checkbox" name="" id="c${music.mid}" class="chick1" value="" /></td>
					<td class="th2">${music.name}</td>
					<td class="td_img" id="t${music.mid}">
						<img  style="display: none;"  src="icon/播放.png" onclick="play('p${music.mid}');" id="p${music.mid}" class="icon_1" onmousemove="change_1('p${music.mid}');"onmouseout="change_2('p${music.mid}')">
						<img style="display: none;" src="icon/下载 (1).png" onclick="download('l${music.mid}');" id="l${music.mid}" class="icon_2" onmousemove="change_3('l${music.mid}');"onmouseout="change_4('l${music.mid}')">
						<img style="display: none;" src="icon/删除-填充.png" onclick="del('d${music.mid}');" id="d${music.mid}" class="icon_2" onmousemove="change_7('d${music.mid}');"onmouseout="change_8('d${music.mid}')">
						<!--<img style="display: none;" src="icon/收藏 (2).png" onclick="'s${music.mid}');" id="s${music.mid}" class="icon_2" onmousemove="" onmouseout="">-->
						<c:set value="1" var="visitCount" property="visitCount" />
						<c:forEach var="music2"  items="${listF}">
							<c:if test="${music.mid==music2.mid}">
									<img style="display: none;" src="icon/收藏 (2).png" onclick="" id="s${music.mid}" class="icon_2" onmousemove="" onmouseout="">
									<c:set value="0" var="visitCount" property="visitCount" />
							</c:if>
						</c:forEach>
						<c:if test="${visitCount==1}">
								<img style="display: none;" src="icon/收藏 (1).png" onclick="save('s${music.mid}');" id="s${music.mid}" class="icon_2" onmousemove="change_9('s${music.mid}');"onmouseout="change_10('s${music.mid}')">
						</c:if>
						
					</td>
					<td class="th3">${music.singer}</td>
					<td class="th3">${music.album}</td>
					<td class="th4">${music.time}</td>
					<%
						if((int)session.getAttribute("count")==1)
						{
							session.setAttribute("count",2);
						}
						else{
							session.setAttribute("count",1);
						}
					%>
				</tr>	
          		</c:forEach>
				</table>
			</div>
		</div>
	
	<jsp:include page="foot.jsp"></jsp:include>
</body>
</html>